package com.joyintech.enums;

/**
 * 产品属性(投资方向)
 */
public enum CvrTypEnum {

    ONE("1","借意险"),
    TWO("2","寿险"),
    THREE("3","万能险"),
    FIVE("5","分红险"),
    SIX("6","出行险"),
    TEN("10","重疾险"),
    ELEVEN("11","医疗险"),
    THIRTEEN("13","年金险"),
    FOURTEEN("14","健康险"),
    FIFTEEN("15","意外伤害险"),
    NO("16","未知"),
    ;


    private String code;
    private String name;

    CvrTypEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CvrTypEnum getNameByCode(String code) {
        for (CvrTypEnum codeEnum : CvrTypEnum.values()) {
            if (codeEnum.getCode().equals(code)) {
                return codeEnum;
            }
        }
        return CvrTypEnum.NO;
    }
}
